cmake_minimum_required(VERSION 3.20)
project(compare_cloud)
include_directories(
  include
  ${Boost_INCLUDE_DIRS}
  ${PCL_LIBRARY_DIRS}
  ${EIGEN3_INCLUDE_DIR}
)

find_package(PkgConfig REQUIRED)
pkg_check_modules(JSONCPP jsoncpp)
include_directories(${JSONCPP_LIBRARIES})

# find dependencies
find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(std_msgs REQUIRED)
# 查找依赖
find_package(geometry_msgs REQUIRED)
find_package(nav_msgs REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(pcl_conversions REQUIRED)
find_package(PCL REQUIRED)
find_package(tf2 REQUIRED)
find_package(tf2_ros REQUIRED)

add_executable(compare src/compare.cpp src/angle_compare.cpp src/jsonread.cpp)
ament_target_dependencies(compare rclcpp std_msgs)
# uncomment the following section in order to fill in
# further dependencies manually.
# find_package(<dependency> REQUIRED)
# 链接库
ament_target_dependencies(compare
  rclcpp
  sensor_msgs
  pcl_conversions
  tf2
  tf2_ros
  geometry_msgs nav_msgs
)
target_link_libraries(compare ${PCL_LIBRARIES})
install(TARGETS
  compare
  DESTINATION lib/${PROJECT_NAME})

install(DIRECTORY launch config
  DESTINATION share/${PROJECT_NAME}
)
ament_package()
